package cn.bcsp.hotevent.service.impl;

import cn.bcsp.hotevent.mapper.HoteventsMapper;
import cn.bcsp.hotevent.pojo.Comments;
import cn.bcsp.hotevent.mapper.CommentsMapper;
import cn.bcsp.hotevent.service.ICommentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author astupidcoder
 * @since 2021-08-23
 */
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments> implements ICommentsService {

    @Resource
    private CommentsMapper commentsMapper;

    @Resource
    private HoteventsMapper hoteventsMapper;


    @Override
    public int addInto(Comments comments) {
        int res = commentsMapper.insertComments(comments);
        if(res >= 1){
            int update = hoteventsMapper.update(comments.getHotEventsId());
        }
        return res;
    }
}
